The connection between your home and internet (or in simple words ISP) is called WAN (Wide Area Network). And the connection between your devices and/or WAN is called LAN (Local Area Network).
A modem creates the WAN. It translates the signals from the ISP so that your devices can communicate with it. You mandatorily need a modem to connect to internet.
A router as the name suggests, routes the data transfer between devices. You don't need internet to create LAN. You can have a LAN among various devices like phones, computer, laptop etc. and use it for file sharing, printer sharing etc. even without a internet connection.
Primary use of the router is to create a LAN for your various devices and assign IP addresses for those devices. Also you can put a firewall on the router to protect yourself against security threats.
I made this diagram for your better understanding..