High-throughput journals may have multiple editors "under" the editor in chief, and each such editor will have multiple associate editors. Thus, the workload for every single editor (and AE) is more manageable. For instance, I am an AE for the International Journal of Forecasting, which operates on this model. In 2023 (see the annual report), it had six editors (plus the editor in chief) and 53 associate editors (plus two book review editors), to handle 809 submissions. At the end of 2023, there were 174 manuscripts under review or in revision.
The editor will typically have already read the manuscript before sending it out to the AE, since they may desk reject before it ever reaches an AE. One hopes they still remember it when the reviews come in multiple weeks or months later... if not, they can always re-read the manuscript. And of course, the editor is the decision maker, and is not bound by the AE's or the reviewers' recommendations.
in which situation does the EiC not follow the recommendations of the AE?
(Substitute "editor" for "EiC" here.) This will depend very much on the editor in question, and on the particular situation. If the reviews do not match their impression of the manuscript, or if the AE's recommendation does not seem to make sense for some other reason, or if the editor believes this particular paper works will in conjunction with some other paper in the works, which neither the AE nor the reviewers have visibility on, or in a host of other situations, they may decide to go against the AE's recommendations.