It works, at a huge scale, and poorly.
Post a new app to the App Store. Poll various friends to see when they can actually access it. You can watch their database replication slowly happen in real time over the course of hours, as the app randomly appears for more and more people. People will often be able to access the app through a direct link but not through search for a few hours before everything synchronizes. You have to give it about twelve hours before you can reliably count on all users being able to access it.
Let's compare this to, for example, Google search. The scale on Google's end is much larger. What's worse, they're indexing external content that they have no control over. Despite these handicaps, they have no problem with rapid, coherent updates. More than once, I've typed up a reply to a comment like this, posted it, then hit up Google for some additional information and found my own comment posted just minutes ago among the top results.
Google, working with external data they don't control, serving vastly more requests of vastly more complexity, is able to provide coherent results within a few minutes, while Apple takes hours to roll out new data that you explicitly send them.
That kind of stuff is where ideas about code quality come from. No amount of "but they make lots of money and are popular" can counter this.