What is Player Agency and what is it good for?

Agency, specifically player agency, is a term that frequently comes up as a reason for why a particular rule or GM decision is better than another. How is agency defined in this context and why is it important?

(Related: What is railroading and is it a bad thing?)