A guest post is a new article, written specifically for the host site. You control the surrounding content, the framing, and exactly where your link sits.
A niche edit inserts your link into an article that's already live and already indexed. Because the page has ranking history, the link can start contributing to your target page sooner than waiting for a brand-new article to get crawled and trusted.
Guest posts tend to fit better when you also want the placement itself to carry some brand or topical value beyond the link. Niche edits tend to fit better when you have a specific page that needs a contextual link quickly.
Most campaigns end up using a mix of both, weighted toward whichever fits the target page's current situation.