How does YouTube’s dynamic loading on the homepage work?

I’m making an extension that will put a button under each video on the home page but I found out very quickly that this wouldn’t be possible by just using a selectAll statement. The only thing that a selectAll statement does is it retrieves the first 3 rows of videos on the homepage. I think what’s happening is there are videos being loaded after the page has loaded thus the elements don’t exist at “document_end”(this being when my chrome extension is injecting the js/css onto the page). I would be looking for something like an event listener but an explanation as to why this is happening would be appreciated as well.