It appears to me that "collections" isn't something defined by the Ordinals protocol, and it's not something that gets stored on chain. Rather, there appear to be centralized repositories to which people can submit their collections to be indexed as such. The Ordinals Wallet has a GitHub repository that accepts collection submissions via pull requests. Ordswap appears to be accepting them using a Discord bot. The submission format is different in each case. There might be other repositories, but there were those I could find quickly. I am not sure if there is any exchange of data between the marketplaces, but I would guess there isn't and that creators are expected to submit their collections to every marketplace where they want to be listed.