Patents with open source licenses? (basic explanation wanted)

I’m almost done with a decent-sized open source project and I want to choose a license. It’s a web app (totally client side HTML/CSS/JS) for controlling model trains remotely (some of you may remember this project).

Anyway, I’m leaning towards the AGPLv3 since it seems to make it totally impossible for any company to snatch up the software, tweak it slightly, and start calling it their own/charging for it/all that. I’m not really that concerned about it, but I don’t want to do the MIT License or one of the really permissive licenses like that just in case. It’s basically a first-of-its-kind app so I want to make sure it stays open and free and doesn’t get abused.

I have one question: GitHub’s says under the AGPL, “Contributors provide an express grant of patent rights.” What exactly does that mean, practically? Does it mean anyone who contributes code to the software can’t patent the code for themselves, and the project itself retains all patent rights? I’m only in high school so my knowledge of patents is a little fuzzy, so I was hoping someone could shed some light on what this means.

TL;DR - What does the “Contributors provide an express grant of patent rights” bit of the AGPL actually mean? Explain like I’m 5

I’m also open to opinions on the AGPL and licensing in general if someone has a better idea for a license than me

Don’t quote me on this or take it as your final answer.
I am very rusty because it has been 10 years since I took patent law.

What I believe that kind of open source license means is: Your code may be used and modified but it must always be linked to your original patent. No matter how your code is modified, it must have your name on it.

For example:
If you invent Patent #346.72-A The windshield wiper, but decide to give it away for the betterment of mankind, all car makers can use it but they have to say this device was invented by K4KFH. You may not make any money off of it, but someone may see your not-for-profit patent and hire you to make the next profitable one.

If your code is used for commercial purposes, you can ask for a cut.
If they remove your patent from your code, you can sue.

sounds like a good patent and code release. you can use it but credit is due where credit is due. if you want to make cash off it give me a cut for making it. and anyone can use it if you pay or not if your not for profit. sounds like a winner to me.