Is your math ability all genetics?

I feel like there are a lot of instances where I have to keep rewatching the videos or reread textbook multiple times to understand the concept, but when it comes to doing practice questions and past paper practice, I sometimes never understand what is going on or how to approach. Additionally, it seems like every time I approach a question, my mind just goes blank and I just look at the mark scheme and still can't understand it despite countless hours of studying. I also ask the teacher every time I get stuck but sometimes still get confused.

So do I need to something different, work harder, or is it just genetics?