You absolutely can have a complete mental model of the thing you're coding. Especially if you properly break it down into pieces (modules, libraries, functions, whatever you want to call them) which can be understood as a unit.
The biggest problem is that many people use libraries as a crutch, without any knowledge of how they work or what they actually do.
The biggest problem is that many people use libraries as a crutch, without any knowledge of how they work or what they actually do.