DXC Technology interview question

Whats the logic behind Bubble sort?