That depends on how you define "capitalism" and how you define "end goal".
For example in some narratives forwarded by apologists of capitalism, capitalism is described as a meritocracy, aristocracy, technocracy or any other variety of a prosperity gospel or it's mirror image. Like instead of seeing the vast inequality among people as a problem those narratives argue that those who are better off are simply "better" or vice versa that being better off is a sign of being "better". Where "better" can mean anything from "physically stronger" and "more capable" to "more moral" or whatnot.
So to those, capitalism, the economic system responsible for this inequality due to it's mode of production, isn't solving any problem and therefore doesn't have an inherent "end goal" but is just promoting the best people into positions of power.
Now you could argue whether "power" itself is a suitable method of problem solving or whether a top-down planned approach only really works for problems that we've already solved and only need to optimize and whether ANY problem has been solved to that level at all. And how cruel that would end up being if that a) doesn't work or b) only works for the "commander" who treats the rest as slaves in it's plan. How that whole narrative of wealth as a sign of competence is shaky at best and how you could count numerous examples where that narrative doesn't fit at all.
However that would imply that either capitalism and the inequality it produces will either "wither away" when the "big problem" that "requires the best to lead" is finally solved.
Or this is a permanent structure where you're always either leading (the minority of people) or following (the majority of people). At which point we're back at a conservatism where the structural hierarchy of inequality is presented as a "natural order" or "how it's supposed to be". A concept that is very antithetical to human history and pretty much fallen out of favor once education levels and transparency of the political process made it obvious how little that concept actually worked.
However that is just the apologists narrative for why the inequality produced by capitalism is secretly fine. The more fundamental problem is that it DOES creates and/or intensifies existing inequalities, which is a problem pretty ingrained in it's mode of production. So despite all these narratives likely being "false" or rather irrelevant to how capitalism actually works, there somehow needs to be a legitimization for why inequality is a thing because that creates some social tension and conflict.
And how does it work? Well if all expenses of capital are meant to return a profit and more capital= more profit then sooner or later everything would be in the hands of 1 person.
Which creates 2 problems. A) How would that person keep that, which likely entails that they have to share their wealth with underlings to prevent having to share it with even more people and B) What does it even mean to own everything.
So A) is largely a technological limitation. Like the limit of feudalism was largely the call of duty of the empire or in other words probably something like the speed of horses, ships and carrier pigeons. Which necessitates lower
aristocrats and fief managers who gained ownership and autonomy for loyalty. Now with capitalism the state takes the monopoly of violence and is omnipresent so that the necessity for fief managers to have ownership and autonomy has decreased. Or in other words you can have a global empire without owning it as a state. The state is just supposed to uphold the status quo.
Which is again where you need narratives to convince the sovereigns of these states (often the people) why the status quo should be tolerated in the first place. So despite technically being about economics capitalism is also a socio-political construct. As it needs a state to protect the status quo upon which it relies, so it must either convince, bribe, coerce, threaten or be the state.
And B) suppose it does become this omnipresent force of nature that owns everything then people are still in need of things. So unless the system possess the ability to produce without them,to kill/control and prevent them from rioting against the system it needs to give these people a way to survive.
And here there are again different scenarios. Like people could be forced to work towards their own enslavement and genocide. Like your supposed to automate a systems so that it is able to work without you and without your consent and is able to effectively suppress you.
Or you're supposed to continuously innovate and generate new products to please your overlords in exchange for everyday necessities. Maybe they even realize that giving you more stuff and autonomy grants better results, thus reducing inequality or they don't care for novelty all that much and rather keep the inequality.
The problem is that capitalism itself is just a paperclip maximizer or maybe a "profit" maximizer. So what it actually ends up doing depends on the human element in it and that is to some extend less predictable.