Hermit crabs are small marine crustaceans and are in fact anomura, not real crabs. They are soft-bodied and that is why they have to borrow a cast-off gastropod shell that they will carry, live in and that will protect them from predators.
The first one was visibly not entirely satisfied with its own shell and wanted to steal the shell of the second.
Or, maybe, they were just fighting for food (second theory circulating in the main lab) … Who knows!