SEO and number of products per page

I’m curious if the numbers of products displayed on a page would effect seo. It would seems like a page with more products might have an advantage as it has more keywords and images displayed. But then how many would be too many? I’ve visited some sites where you scroll down and more and more products load and it just slows down. I have a page that currently only displays 12 products per page getting beat in rankings by a page that has like 21 products. Looking for any thoughts on if more products might be an advantage and how many might be too many.