In many cases, knowing that something works is as valuable as knowing how it works. Knowing that the sun comes up everyday at a semi-regular time is almost as useful as knowing how the celestial bodies are floating through space. Knowing that turning off a computer and turning it back on again makes things work right is almost as useful as knowing exactly what things in memory were causing an unstable system state. Knowing that adding a line of code to a particular place in an application makes it work in all browsers is almost as useful as knowing that that line of code changes how certain browsers interpret the site.
Just knowing it works is good enough until something changes and it doesn’t work anymore. Something is always changing. The sun will not come up tomorrow at the same time it did today. The way computers store their information will change (already has changed) and turning it off and back on again won’t always fix a problem. That “magic” line of code will only work in a couple of browsers and doesn’t do anything in the others.
In some cases you can get away with waiting until something changes to learn how everything works. Unfortunately, with the world being as complex as it is, this strategy can become overwhelming quickly when you have a bad week and have to figure out how 5-10 different things work at the same time. I recommend that most of the time you figure out how something works the first time you encounter it. Time doesn’t always allow that, but many times it does.
Every thing you learn about adds to a foundation and framework for you to learn more quickly in the future, building one block on top of another.