Related
Internet Gateway - AWS Subnet - AWS
Just think of IGW as a switch in the VPC that determines whether you want to allow public IP addresses to function in the VPC. If you don’t enable the IGW, public IP addressing won’t work. You define a public subnet by setting the default route for the subnet to point to the IGW.
A NAT gateway has to be defined in a public subnet (a subnet with the default route to the IGW) because it needs a public IP address. Anything that needs a public IP address needs to be in a public subnet.