The footprint is a robot's projection to the ground. In a simplified 3d world (no levitating obstacles that are not connected to the ground) it can be used to make sure the robot doesn't collide with its environment. It is used by Nav2 to avoid collisions during planning.
In other words, it is used to make sure that the robot does not collide with the obstacles specifically on the costmap.
There are two ways to set it: using the footprint (a shape) or robot_radius parameter of the global and local costmaps.
The value defined in the footprint parameter is an ordered vector of 2-D points. The first and last points in the vector are joined into the last line segment to close the footprint's shape. As an alternative, you may also use the robot_radius parameter wherein circular footprint is automatically generated and centered at base_link. In cases both the footprint and robot_radius parameters have been defined in the configuration, the footprint is used.
For the global costmap footprint, the decision to choose between the robot_radius (circular) or footprint (polygon) parameter depends on the robot, its environment, and the path planning algorithm you use. Even if you are working with a non-circular robot, there may be situations where a circular footprint is acceptable. For example, path planning algorithms like NavFn assume that the robot is circular since it only checks for collision per grid cell. On the other hand, algorithms such as Smac Planner's Hybrid-A* perform collision checking on the robot's polygon-shaped footprint if possible and necessary. Hence, it might be useful to use a polygon-shaped footprint.