Potassium channels are essential for maintaining a normal ionic balance across cell membranes. Central to this function is the ability of such channels to support transmembrane ion conduction at nearly diffusion-limited rates while discriminating for K+ over Na+ by more than a thousand-fold. This selectivity arises because the transfer of the K+ ion into the channel pore is energetically favoured, a feature commonly attributed to a structurally precise fit between the K+ ion and carbonyl groups lining the rigid and narrow pore. But proteins are relatively flexible structures that undergo rapid thermal atomic fluctuations larger than the small difference in ionic radius between K+ and Na+. Here we present molecular dynamics simulations for the potassium channel KcsA, which show that the carbonyl groups coordinating the ion in the narrow pore are indeed very dynamic ('liquid-like') and that their intrinsic electrostatic properties control ion selectivity. This finding highlights the importance of the classical concept of field strength. Selectivity for K+ is seen to emerge as a robust feature of a flexible fluctuating pore lined by carbonyl groups.