It is a simple fact of guitar life: strings ultimately will fail. How and why and when they fail is subject to the quality of the strings, to be sure, but also to how those strings are maintained over time. Guitar strings typically fail for a few different reasons, including those having to do with wear, stretching and corrosion.
Good guitar strings care starts with the basics. Simply cleaning the guitar after use will improve the life span of the strings (and the guitar). Also, be sure that when you string your guitar, that you do not overstretch the strings. Also, be on the lookout for cracks in the bridge that can cause wear in the strings.