Both blend. Both cost about the same. Both live in most kitchens. Here is when each one is the right choice.
Immersion blender: strengths
Blend directly in the pot (no transferring hot soup). Emulsify in the container you will store the result in (no extra bowl to clean). Small batches (mayo from one egg). Precise control (hold the button briefly for chunky, longer for smooth). Minimal cleanup (the wand is the only thing to wash).
Regular (jar) blender: strengths
Higher torque motors handle tough ingredients (frozen fruit, ice, hard vegetables). Larger batches. Truly smooth textures — an immersion blender leaves some texture; a good jar blender goes to pudding-smooth. Hot liquid to cool liquid all-in-one for smoothies.
When to buy which
If you make soups: immersion blender first. If you make smoothies: jar blender first. If you make both regularly: get both — they are different tools solving different problems, not competitors.