how in the world is it possible to have a comprehensive knowledge of
all of the sophisticated computers and electronics that are required
to interface to fly a plane safely?
The same way you learn about any aircraft, you study the operational manuals and related documentation. In theory aircraft that use the airbus fly by wire system are safer as they offer protection against the pilot inadvertently putting the aircraft into a dangerous situation (high G, stall, etc.).
I think that there are some misconceptions in your question about the required training for flying something like an A320. Pilots are required to know how the aircraft will respond in all situations and the errors and messages the computer may throw at them. This is no different than understanding what a tumbling mechanical attitude indicator is doing or how to identify a bad analog instrument. Broadly speaking failures are failures and identifying them has more to do with situational awareness, understanding of your systems, and to some extent experience. Digital cockpits merely change the text and pictures in the books but still require the same basic fundamentals to identify a failure.
Some might also say that analog cockpits are more complicated than their digital counterparts. So much so that jets that once required a crew of 3 in the analog days can now be flown by two.
It seems to me that in truth, pilots have just enough knowledge to
operate these new planes and systems under normal conditions and the
moment a malfunction occurs it becomes a race to a safe landing with
only troubleshooting guides to help understand what is happening and
try to offset it long enough to get the plane safely of the ground.
Pilots do not have just enough knowledge and frankly that is short changing the vast amount of hours required to be in command of even an A320. Pilots train in full motion simulators for all kinds of emergencies so that when the time comes they only need a quick reference card to get the plane safely on the ground.
Digital aircraft are not necessarily kaput if one thing fails and systems are designed such that a failure does not cause down stream effects. Systems often can independently be shut off and pulled out of sequence in the event of a failure. On top of that there are lots of failure modes (even in the side stick planes) that allow for all kinds of direct control.
But how does this all tie into a plane being safer...
The FAA main advice in any emergency is to "fly the plane" most training stresses (and most accidents cite a lack of) "Situational Awareness" so if we can provide a cockpit that offers a pilot more information on how the plane is flying, where they are, and whats going on we can make it easier to fly the plane and maintain your situational awareness in any event (even if some systems are failing). That all trickles out, ultimately, to a safer plane.