Google and other engines count backlinks as a ranking factor and your website ranking also depends on the no. of backlinks your post has.
So, the Guest post allows you to get the do-follow backlinks in a natural manner. That’s why search engines favor guest posts.
Because it is the natural and quality way for link building.