Sometimes it’s shaped like an arch. Is this just for aesthetics, or is it structurally necessary?
Friction. Vertical bricks have a longer edge to joint to the next brick. A horizontal brick with no support below it would only have a small area at the side to help it stay there. Vertical bricks are also held better with less ability to wobble in the direction the wall runs.
So they are just better at staying in place. For the rest of the wall being horizontal helps keep the bricks from pulling apart and the wall cracking.
In newer buildings the windows have a steel angle lintel or beam above them that the brick rests on. The bricks/stones are in rowlock or soldier course orientation strictly for aesthetics.
In much older buildings this could have served a structural purpose, with the stones shaped in such a way that they would function as an arch. I don’t know if there are places in the USA that would allow an opening in masonry veneer without a lintel above. Where I work in Canada a steel lintel is required by code with very few exceptions, and even in those excepted cases another type of lintel of equivalent strength is needed.
These days it’s very common to have a steel plate over a window in the outer wall on which the next layer of bricks is stacked instead of the layer of vertical bricks.
Originally it was for support. Laying bricks long ways on the ground is easy since they have something (ground) to rest on and so the stack is very sturdy. Then you suddenly go and put a hole in the middle of that stack (window) and what are the bricks above the window going to rest on? Putting them in an arch configuration is obvious because [arches are very structurally sound under their own weight](https://en.wikipedia.org/wiki/Arch), but putting them vertical and having them tightly pressed together is also beneficial due to the lower ratio of width to contact area with other bricks making them less likely to fall.
I’d imagine modern brick buildings could probably be built without them or just use them for aesthetic reasons, but it likely depends on the age of the building.