MagSafe Connector Pinout
The MagSafe connector is symmetrical. There are two ground pins, and two 16.5V.
Image Source : wikipedia
Only the center pin and one of each other type of pin must be connected for the laptop to charge.
To prove this, I put non conductive tape over different combinations of positive and negative pins. As long as the center pin, and one ground and one positive pin made contact, my laptop successfully charged.
Still worked in both orientations without these pins
Still worked in both orientations without right most pins
As soon as I covered two matching pins (i.e... 1 and 5 or 2 and 4) the laptop failed to charge.
Effectively the pins are mechanically identical to electronic pogo pins. They typically consist of gold plated, hollow brass tube with springs inside.
Image Credit: wikipedia
Over time those springs can wear out. It is common for pogo pins to be rated for 10,000 cycles.
High end pogo pins are gold plated on all surfaces inside and out
Cheap / knockoff pogo pins often are only gold plated on the outside, allowing for corrosion to enter the internal components.
If you read reviews of unofficial Apple Magsafe chargers sold on Amazon, you will find a surprising percentage of reviews mention that the pins get stuck.
The cause of the MagSafe charger to only work when in one orientation, is that 3 of the essential pins are not touching the laptop.
There are two reasons the pins do not make contact.
Insufficient pressure from spring.
I have found that when my MacBook doesn't charge, gently running a clean pencil eraser over the pins and the laptop connector will usually solve the problem for a few weeks/months. This addresses both corrosion and exercises the pins.
I find that new chargers from Apple usually last 2 years before they start exhibiting this behavior.
EEVBlog explanation of pogo pins
Pogo pin durability
Pogo pin corrosion