Default gateway is the last resort, so if there is no other route for the detination then the packet will be sent to the default gateway.
Both static routes and dynamic routing protocols will place routes into the routing table. The route that will get used depends on the cost or metric of the routes themselves
In your network, packets that have a destination address that is not local to that network will use the default gateway to reach the external network.
If configured, a static route will be chosen over any other route because they have an administrative distance of 1. NB,the lowest admin distance is the one chosen.
Then last but not least, if there exists any dynamic routing protocols, they will place routes in the routing table. Depending on which routing protocol is used i.e RIP,EIGRP,OSPF,ISIS,BGP etc, the route chosen over all the others will depend on the metric of the specific routing protocol.