All in the topic

After five runs of the game and a long pen and paper rpg experience (just nothing in the DnD and alike department) , I'm still really unsure of how the system works on its basic.
Today's question : spellcasting.
How does my abilities influence my chances to hit with a damage spell. Say I'm a ranger and I pick the arrow that entangles (can't remember the name) will I shoot it with my DEX ? my WIS ? something else ?
I suspect that they are a direct schooi of magic to ability bijective relationship...but that's the thing ... I suspect and I want to know

And no wiki seems to mention anything like that... sooooo heeeelp please
If you consider wizards who can basically learn any spell , knowing in advance the mechanism would be a great help.