Imagine you are in a critical phase of your project and need some extra helping hands in your team. A medium size agency can cover your demand on the short term, usually easier. The team is already built and well-rehearsed.
But keep in mind to pick your agency wisely when this is important for you. Because due to a chronicle lack of expert developers, the situation might be difficult for to handle for the agency.
A freelancer on the other side might come handy when you have only eventual needs for developing capacities. A freelancer can be shut down easier as he might not make a fixed contract with you, but rather serves on demand.
Agencies usually work with more than one in-house developer, so there is plenty of the knowledge exchange between them. They are often switching between projects and bring some new beneficial insights to big picture.
Agencies have multiple clients and multiple developer. And established agencies know the market and have contacts to different sectors of the industry. They usually bring more experience than a single developer, and in most cases they are using the most current tools and technologies.
Due to their contacts, they might support you in finding good solutions and information about occurring tasks or problems.
And yes, everything has its price. Agencies have a significant overhead you will have to pay. So I suggest you to hire an agency when you have a sales volume of minimum 500k to 1m USD/EUR a year. Everything what is below will probably not justify the expenses of an agency.
Shopware self changed its strategy recently. They are focusing on clients with 5m+ sales volume a year now, which reflects of course in their pricing. So when you are targeting a smaller volume on the long run, you probably want to look into other solutions like WooCommerce etc.
So it really depends on in which phase of your e-commerce enterprise you are and on which level you want to play. The higher the volume, the more likely you will want to hire an agency. The more flexible you want to be, the more likely you will want to hire an freelancer.