Merging joins two lines of history with a merge commit. Rebasing does something different: it takes your commits and replays them, one by one, on top of another branch — as if you'd started your work from there.
Watch closely. The replayed commits are new commits with new hashes; they only look like the originals. The old ones are left behind, unreferenced.
The result is a straight line, which is easier to read and review. The cost is that you've rewritten history — fine for your own branch, risky for one other people have pulled.
Try it
Your feature branch is behind main. Rebase it onto the latest main.
The golden rule: don't rebase commits that other people have already built on.