The things that always blows my mind is how every individual piece of code you read has good, clean, well documented, well tested code. But overall it's just a big mess.
Not everything, though. Infrastructure code and libraries are usually very high quality and very nice to work with.