With regard to subnets. I tend to compare it to classic paper mail.
You need to know how to get to the mailbox ont he street. Either is is local or elsewhere. And it it is elsewhere you need to know where to send it.
So subnet (is local).
Nope. Then go out of the door (default gateway).
That gateway needs the subnet info for the next path.