This is how the slang “get a foothold”
On the ground, snakes meander on elongated scaly shells, which are called belly skins, and provide them with a certain grip when they climb up trees. Some species, such as corn snakes, can actually lift their belly skins out so that more folds form on the belly and get a better grip on any unevenness.
Uses accordion movements
As hoses move between branches, they use a sort of accordion motion. First, the snake gets a firm hold by wrapping its front part around a branch or trunk, but then it takes a firm hold on the branch with its tail and shoots the front part forward.
New research shows that snakes are very careful when climbing trees and use a much tighter grip than they should.
They probably want to avoid falling to the ground and become easy prey, but it also saves energy not having to climb back up.