To expand on KidzSearch's answer, everything is stored in a specific type of database called a MYSQL database. This is what it looks like:

You can click each table, and it will give you thousands of tables containing the following info (I'm guessing on a lot of these, but I'm probably 70% accurate)

Here's an example of when I click on one of the links; I clicked on Polls, and it showed me every poll that has been posted to my site. This includes the corresponding post ID, the number of votes for each option, and what each option was

And yea, just as KS said, they run the site through Amazon Web Hosting (AWS)
Giant tech companies like Twitter or Facebook can scale their sites to enormous sizes using AWS servers; In fact, Amazon Web Services is far more valuable than the actual Amazon shopping company!