Which version of solitaire this is?
I believe you are talking about Gaps (or some variant of it).


  The cards are dealt into four rows of thirteen. The aces are removed and discarded from further play. The gaps that they leave behind are filled by cards that are the same suit and a rank higher than the card on the left of the gap. (For example, 4♣ can be placed beside 3♣.) However, any gap at the right of a King is considered dead and no card can fill it.


Quote from: https://en.m.wikipedia.org/wiki/Gaps