This phrase means that when something is successful, many people will claim some amount of responsibility for it, while when something fails, nobody wants to claim responsibility for it. In other words, success is widely celebrated, while failure is quickly forgotten.