Recognizing good quality electrolytic capacitors
This is a challenging question to answer. The best answer I can give is "caveat emptor". 

You first need to know that the brand is reputable. My experience leads me to implicitly trust these brands: Nichicon, United/Nippon Chemi-con, Rubycon, Panasonic and Samxon. Major manufacturers should be able to provide life test data to justify the hours-of-life ratings that are on the parts.

You also need to know that the application isn't over-stressing the capacitor. A bad design that leads to excess ripple current or operating temperature or excessive voltage (or some combination of the three) may cause even the best capacitors on the market to fail prematurely. Using a general-purpose capacitor in a circuit that needs a high ripple, low-impedance capacitor is a prime example of where things can go bad quickly. A good cap in a circuit with good design margins should last years without issues, as the design will accept some degradation of the capacitor over time before failing.

Only when you know these two factors would you even be in a position to judge why a capacitor failure occurred.

You need to trust your supplier. The caps need to be stored in proper conditions with date-of-manufacture to determine if any forming/healing needs to be performed on them before sending your circuit out into the world - ideally, the caps should be new enough that this isn't an issue, but sometimes you need a certain value and you have to make do with whatever you can get.

Counterfeit parts are a huge problem and even a reputable shop (or international distributor) can occasionally be fooled, especially with 'lean' warehousing and part inventories moving from place to place.