If you open your browser's network panel, you can see the secret sauce here: GitHub's API. Each time you open a file, the UI makes a request to GitHub's API for the content. That's why it's dramatically faster than cloning a repo; instead of pulling the entire history of the repo upfront, it dynamically requests only the files viewed.