It was reported in Peopleware that bugs are somewhat consistent across LOC so someone who implements a solution in 10x fewer LOC also has 10x fewer bugs.
A lot of complexity comes with the fact that people code for the future with "well, we have to make this a platform solution in case they want to change stuff in the future, so let's add a configuration object, a datastore to pull it from, and a cache to limit database hits, with a cache eviction policy that's also configurable via ..."