How is payment methods grouping implemented on the frontend checkout page?

See also: