Camtasia Video Editor seems like a popular go-to for a lot of Facebook memes.
You can do it on free software, but you will need to work a steeper learning curve.
My recommendation, get friendly with YouTube how-to videos for the software of your choice.
I've used Final Cut Pro, Adobe Primere, Adobe After-Effects, Sony Vegas (now rebranded by Magix), any many more.
They can all accomplish this basic task, how you get there and how fast depends on how much you wanna spend.
If you have time to learn, a good free solution is Lightworks.
BONUS: If you're on Linux, check out Shotcut.
Code:
Quick YT search:
https://www.youtube.com/watch?v=Qimf9cFFkkM