RAW nothing happens to either creature on the shover's turn
The question does not specify, so let me set some ground conditions: a size medium (or small) character has been shoved into the 5' x 5' space occupied by a size medium (or small) ally. This would be a common situation and it comes with the fewest special rules and interactions.
On the shover's turn, the shover moves the lead into the space behind where the lead was, a space currently occupied by an ally of the lead. Since this is not the lead's turn, and this is not willing movement, there is no rule preventing this movement, no rule preventing the two allies from temporarily sharing the space, and no rule assigning immediate consequences for sharing the space.
From Moving Around Other Creatures in the PHB:
You can move through a nonhostile creature's space. In contrast, you can move through a hostile creature's space only if the creature is at least two sizes larger or smaller than you. Remember that another creature's space is difficult terrain for you.
Whether a creature is a friend or an enemy, you can't willingly end your move in its space.
There are no implied consequences, no checks to fall down, or support, or knock over. The only RAW immediate consequence is that now the two allies are unwillingly sharing a space.
They must try to move away, though
However, whichever of the allies next has their initiative must attempt to leave the shared space, since they cannot willingly end their move there. From solely the RAW in the PHB, and since movement can be broken up over the course of the one's turn, this effectively means that they can take their whole turn of actions so long as they move out of the space by the end of the turn. However, it may be RAI that moving out of the shared space must be their first action on their turn, and that they cannot complete any other actions until they have done so.
If the shover moved the lead back but then did not itself advance into the lead's former space, there is likely an unoccupied space in front of the shared space of the allies. Whichever ally has the next initiative could simply move forward into that space, resolving the situation.
If, however, the shover moved into the space after pushing the lead back, or if another creature subsequently moved into the space, the allies may not have an easily-accessible unoccupied space. In this case they could attempt to retreat to the end of their own line (although given that their own space and all the spaces of their allies behind them are difficult terrain, they may not have enough movement to do so). If permitted an action before movement, they could also attempt to open up a space by making their own shove attack on the occupant of an adjacent space, including whoever now occupies the space the lead ally formerly held. They may have other special forms of movement (climbing movement on top of the crates and barrels, or down into the cistern; teleporting, wall-climbing or flying movement provided by spells, magic items, class features, or feats) that would allow them to move out of the shared-space situation. If there are no movement options which will allow them to reach an unoccupied space, however, there are no other RAW consequences - again, they may not willingly share the space, but there are no restrictions on unwillingly sharing the space.
Implied consequences
From Creature Size in the PHB:
Each creature takes up a different amount of space. The Size Categories table shows how much space a creature of a particular size controls in combat...[size categories table]
...A creature's space is the area in feet that it effectively controls in combat, not an expression of its physical dimensions. A typical Medium creature isn't 5 feet wide, for example, but it does control a space that wide. If a Medium hobgoblin stands in a 5‐foot-wide doorway, other creatures can't get through unless the hobgoblin lets them.
A creature's space also reflects the area it needs to fight effectively. For that reason, there's a limit to the number of creatures that can surround another creature in combat.
As anyone who has ridden in an elevator can attest, two medium-sized creatures can fit in a 5' x 5' square. The rules above specify that sharing a space is not about a physical packing limit, but rather about 'the area needed to fight effectively'. Despite this, the rules do not specify a penalty for not being able to 'fight effectively'.
A DM looking to impose such a penalty should consider the rules about Squeezing:
While squeezing through a space, a creature must spend 1 extra foot for every foot it moves there, and it has disadvantage on attack rolls and Dexterity saving throws. Attack rolls against the creature have advantage while it's in the smaller space.
Squeezing occurs when a creature is occupying a space smaller than that needed for it to 'fight effectively', so it is a good approximation of when the space itself is large enough but is being shared with an ally. The 'extra foot of movement' penalty already duplicates the difficult terrain imposed by the shared space, so that would not be additional, but a DM could consider giving each ally in the shared space disadvantage on Dex saves and attacks, and advantage to be attacked. These possible penalties for unwillingly sharing the space with the ally are not RAW consequences themselves of sharing the space, but are reasonable and appropriate interpretations of what being unable to 'fight effectively' means.