Routers learn about routes to other networks either from other routers via routing protocols, or the routes are configured by the administrator, i.e. static routes.
There are many reasons why you might have both on your router. As you may already know, routers choose a particular route based on the best (longest) match to the destination. This is irrespective of whether the route is dynamic or static.
If both static and dynamic routes are the best match, routers use an attribute called Administrative Distance to choose the route. In almost all cases, static routes are preferred over dynamic ones.