Remapping is the process of changing the image geometry in order to fit to the adjacent images that should contribute to a panorama.
Although the software remaps in one single step, one can conceptually identify several logical steps.
Camera image to sphere
The camera image has to be transformed into angle space, which here is visualised as projecting the image from a virtual camera, reversing the light path, onto a sphere.
Generally, one is free to choose any orientation of the virtual camera/projector. But for panoramic images, one wants to align these images. The usual software approach is to mark a set of same features in image pairs, and have the distance between such marker pairs minimised in an overall optimisation process.
Images in the computer environment are flat, hence one has to remap the spherical geometry. This can be a general mathematical mapping function. Some mappings, as the rectilinear projection below, can be visualised as an optical projection, using a point light source in the centre of the sphere.