These are some comments that originally appeared on the OP's earlier question (linked above), gathered together here as an answer:
The notion of automorphic representation (as an irreducible representation of an adelic group) is a generalization of the notion of Hecke eigenform. This aspect of the theory of automorphic forms (i.e. the theory of Hecke operators and their simultaneous eigenvectors) was initiated by Hecke, as a means of understanding and generalizing Mordell's proof of Ramanujan's conjectured multiplicative relations for the $\tau$ function. The notion of automorphic form itself arose as a generalization of the notion of modular form. The latter arose out of the study of elliptic integrals and elliptic functions.
The generalization to automorphic forms took place over a long period of time, and was placed in a representation theoretic context by Gelfand and his school (as far as I know): they shifted the focus from functions on $G/K$ satisfying an automorphy condition under the action of $\Gamma$ to functions on $\Gamma\backslash G$, which then admit a $G$-action. (Here $G$ is a real semisimple group, say.) From this point of view, the interpretation of Hecke operators in terms of an adelic group action is not so remote.
But there are lots of other traditions feeding into the modern theory of automorphic forms, too. I believe that Maass was motivated to introduce his Maass forms in response to Hecke's theory relating Grossencharacters for imag. quad. fields to CM modular forms; Maass introduced automorphic forms that can play the same role for real quad. fields. I think that Selberg was motivated by Maass's papers to then study the spectrum of the Laplacian on modular curves, which led him to develop his trace formula, and, along the way, to effect the analytic continuation of Eisenstein series. It was generalizing this result to arbitrary groups that then led Langlands to discover general automorphic $L$-functions (see his book Euler products).
From the beginning of the theory of modular forms, theta series (generating functions of quadratic forms) had played a key role, and Siegel's work on more general automorphic forms was aimed at, among other things, generalizing this theory. It was Tamagawa (I think) who saw how to phrase some of Siegel's main results in terms of properties of the adelic quotient $G(\mathbb Q) \backslash G(\mathbb A)$, and he (and then Weil in his book
Adeles and algebraic groups) are thus responsible for introducing adelic groups into the subject (and for a reason not directly related to the theory of Hecke operators).
The realization that algebraic number theory and automorphic forms were related by (what we now call) modularity was something that evolved slowly, over a long period of the twentieth century. Even when it became concretely articulated, in the 60s and 70s, there were several strands of development feeding into it: of course there is the work and ideas of Langlands,
who defined automorphic L-functions in general, and saw directly the relationship between his functoriality conjecture and Artin's conjecture, and more broadly saw that his $L$-functions were candidates to be Hasse--Weil (i.e. motivic) $L$-functions; but there was also the work and ideas of Taniyama and Shimura about modularity of elliptic curves, Shimura's work on (what are now called) Shimura varieties (which gave another, previously unknown, link between arithmetic and automorphic forms), Serre's ideas about 2-dimensional Galois representations attached to modular forms, Weil's converse theorem (which was certainly a
decisive result, showing as it did that if Hasse--Weil $L$-functions had the anticipated properties, they were going to have to be automorphic $L$-functions) --- a result
which generalized earlier results of Hecke, and so on.
To quote Langlands on the subject of automorphic forms: It is a deeper subject than I appreciated and, I begin to suspect, deeper than anyone yet appreciates. To see it whole is certainly a daunting, for the moment even impossible, task.