This got me curious on how Web game hosts do it!
I want to preface this by saying that before you embed someone else's game onto your site, then unless the games are out of development/abandonware (like, if they're not Flash games

), you should probably contact the creator to let them know! So often, people developing browser games will share that game in a way to where it's connected to that person's name & other works, like on their Newgrounds or Itch account.

Now, from what I can tell, it looks like a standard way to embed a browser game is to put the game in an iframe containing a page that has all the game elements in it. The stuff that's actually in the iframe page will vary. Sometimes, it's a <canvas> element with a big long script that loads the assets & runs the game, but it might also be a React app or a Ruffle player, which are a couple of other JavaScript tools that can move things around in an iframe to make a game work. A lot of the time, it's not even intended for you to embed by hand!
The game code that goes into the iframe will so often be generated by some sort of framework or tool like under Node.js Package Manager. However, the Flash-games player Ruffle
has "self-hosted" versions on its downloads page to embed Flash games by just following the "README" instructions that come with the .zip download. Putting a Ruffle game onto an iframe page on your site
can be super simple, but it does require a reference to the .swf containing the Flash game. Once you have that, you should be set to host some classic Flash games on your site!