The way our brain works is not made for the way we try to make it work.
Our brain instinctively develops very simple models of extremely abstract systems. We do not learn mathematics starting from the axioms and then physics and chemistry in order to combine all this understanding to walk. We have the will to move and the example of those who can move and somehow try to make that work.
And actually, this is a wonderful thing. It's the exact opposite how computers work. Computers are built from ground up. The idea, that to use computers we must think very much that way is not healthy. It is what drives our most entertaining yet timewasting idiosyncrasies: The need to reinvent the wheel over and over again.
Frankly: we do not have the time. At least not as much as we'd need to.
That is why many clever people out there create a lot of frameworks, libraries, abstraction layers and all sorts of services.
Raise your hand, if you have already created your own ORM (raise), collections library (raise), UI Toolkit (raise) and all sorts of things that were interesting at the time but rarely got past the point where you would dare to open source them and eventually threw most of it away (raise).
The greatest quality of software developers is to create systems, that last long. Without taking so much time, that they're deprecated before being finished. For that you need to be able to work with code others wrote. To understand it from its specifications and to decide which components work well together for which tasks. What kind of architectures to use, what kind of data stores and how to structure them. And so on. How to choose the right components, how to smoothly connect them without rickety glue code all over the place.
You will find, that if you look at popular web frameworks, there's many in Java, C# and PHP, that kind of look all the same. That share a lot of ideas and therefore advantages and deficiencies. You will find, that there's a lot of DB abstraction layers, that allow you to use data stores without knowing details other than the specs of the layers provide and allow you to perform queries in the language of your choice. You will find that frameworks such as qooxdoo allow you to create AJAX apps without knowing any HTML and CSS, that languages such as haXe or platforms such as GWT will allow you to write both client and server in the same language and send data between them transparently.
That doesn't mean, you should never go into detail. But it means you should trust you peers and harness benefit from their work, that they make available for you to harness.
It has been said that the great scientific disciplines are examples of
giants standing on the shoulders of other giants. It has also been
said that the software industry is an example of midgets standing on
the toes of other midgets.
— Alan Cooper
Virtually no library ever written comes without limitation. You definitely will hit a wall at some point when you use general purpose tools. That is the right time to dive into details. And it's good and healthy to play with things on your small, just-for-fun, educational projects. But when you write code, that clearly will have to be around for years, this just isn't working. Do not try to be smart. Be humble.
The competent programmer is fully aware of the strictly limited size
of his own skull; therefore he approaches the programming task in full
humility, and among other things he avoids clever tricks like the
— Edsger W. Dijkstra
You want to be productive without amassing technical debt. Look for frameworks and libraries that together constitute a suitable toolchain to quickly write quality code. Try substituting each tool once in a while to see the advantages and problems. Try understanding the principles within them. Why people do certain things in a specific manner. And should you find a tool that you really like, then try contributing, because that will give you a lot of insight. But as I said: work your way top-down.