The trick is that behind a simple feature like adding friends there are all kinds of use cases: removing friends, blocking friends, removing banned friends, Unicode/ language support, optimizing/caching friend queries, etc.
In Ruby on Rails, you can have a bare bones social network up by the end of the day and run it on Digital Ocean for $5/month. But when you scale to millions of users, you'll be paying millions in bandwidth, storage and staff.
Basically, there's a reason why sure sites like FB need millions in VC cash. And the story if a kid in a basement making a hit site is only the first chapter.
Ironically, FB all started with a couple of college students coding PHP. A lot of web agency clients probably figure it is the same. I would have like to have been there during the time where FB needed to scale rapidly to accommodate for its rise in popularity. For me, those are the most interesting times to work for a company.
You're gravely mistaken.