The pages won't compete in terms of SEO because Googlebot never scrolls the page. The only content that Googlebot ever sees in content displayed via the onload
event. Any content that is only shown after user interaction (such as scrolling or clicking) needs its own URL with links to it if you want Google to find it.
When implementing infinite scroll it is important to ensure that one page of content appears before any user interaction. If you require that users scroll to see the first item, Google will see your first page as blank.
You need to make sure you link to your /posts
permalinks so that Googlebot can find them via links on your site. Even if you expect users to mainly scroll to them, you need navigation to the URLs for the permanent location of the content that Googlebot can find. Just putting the permalinks in an XML sitemap is not sufficient for SEO. See The Sitemap Paradox.
You can change the URL using pushState
as users scroll. As an article scrolls into position on your infinite page, you can change the URL in browser's location bar without ever loading a new page. This allows users that scroll to an article to easily link to that article by copying and pasting the URL from the location bar. If you don't do this, it could hurt SEO because more users end up linking to the home page rather than deep linking to specific content. The deep links are more helpful for SEO than links to your home page.