The government ensures the availability of food grains in the security system by establishing fair-price shops and subsidy distribution through the PDS card system.