The amount of space between the top of the food and the rim of the container is called headspace.
In freezing, headspace allows room for the food to expand without breaking the container. When using unsweetened or dry pack (no sugar or liquid added), leave 1/2 inch headspace unless otherwise directed. When using sugar, syrup, or water pack and wide-top containers with straight or slightly flared sides, leave 1/2 inch headspace for pints and 1 inch headspace for quarts. For narrow-top containers and freezing jars, leave 3/4 inch headspace for pints and 1-1/2 inch headspace for quarts.
In canning, headspace is necessary for a vacuum to form and for the jar to seal. Use the amount specified for each product as directed in the charts.