It is a mess, and the software industry is as well. A large fraction of working programers don't, in fact, have familiarity with what's really going on under the hood of the systems they work on and also don't have familiarity with those "core" things I mentioned, like algorithm theory, basic data structure concepts, and so on. A lot of programming these days involves relying heavily on software libraries that hide all of that, and which have their own bugs and quirks which the programmer is likely unfamiliar with. On top of that, a lot of the day to day work involves either modifying software written by someone else, or working in a very small niche of some large system in collaboration with hundreds or even thousands of other programmers. These hoards of programmers will generally have no idea what one another is doing and wind up creating pieces that, when brought together, lead to more bugs or security vulnerabilities.
When evaluating the performance of programmers, management usually rewards speed of execution (which may later turn out to have led to bugs or vulnerabilities) rather than taking the time to develop the deep understanding required to do a better job. Said managers are often in no way technical themselves, and yet they are expected to lead and evaluate technical staff.
It's no wonder we wind up with a world full of buggy, sloppy products that make very poor use of the underlying power of the hardware.