Rankin-Selberg bound on coefficients For an automorphic L-functions, often there is a bound refereed to by Ramanujan on average, where the coefficients satisfy
$$\sum_{n<x} \lambda(n) \ll x^{1+\varepsilon}$$
Why is this bound true and how does it relate to Rankin-Selberg method? Is it known in general or only for some specific/low-degree L-functions?
 A: Let $\pi$ be an automorphic representation of $\mathrm{GL}_n(\mathbb{A}_{\mathbb{Q}})$, which I will assume for simplicity is everywhere unramified. Following Goldfeld's book (Automorphic Forms and $L$-Functions for the group $\mathrm{GL}(n,\mathbb{R})$), we write $A(m_1,\ldots,m_{n-1})$ for the Hecke eigenvalues of $\pi$, so that for $\Re(s) > 1$,
$$L(s,\pi) = \sum_{m = 1}^{\infty} \frac{A(1,\ldots,1,m)}{m^s}.$$
Then for $\Re(s) > 1$,
$$L(s,\pi \times \widetilde{\pi}) = \zeta(ns) \sum_{m_1,\ldots,m_{n-1} = 1}^{\infty} \frac{\left|A(m_1,\ldots,m_{n-1})\right|^2}{(m_1^{n-1} \cdots m_{n-1})^s}.$$
This has a simple pole at $s = 1$, so that (by, say, any standard Tauberian theorem)
$$\sum_{m_1^{n-1} \cdots m_{n-1} \leq x} \left|A(m_1,\ldots,m_{n-1})\right|^2 \sim \operatorname*{Res}_{s=1} \frac{L(s,\pi \times \widetilde{\pi})}{\zeta(ns)} x.$$
In particular,
$$\sum_{m \leq x} |A(1,\ldots,1,m)|^2 \ll x,$$
and hence via the Cauchy-Schwarz inequality,
$$\sum_{m \leq x} |A(1,\ldots,1,m)| \ll x.$$
A: As a followup to Peter's answer, I wanted to note that "Ramanujan on average" concerns
$$ \sum_{n \leq X} \lvert \lambda(n) \rvert \ll X, $$
which is slightly different than
$$ \sum_{n \leq X} \lambda(n). \tag{1}$$
Typically the conjectured bound in $(1)$ is much, much smaller. For example, if $\lambda(n)$ are the Hecke eigenvalues of a cuspidal Hecke eigenform on $\mathrm{GL}(2)$, then it is conjectured that
$$ \sum_{n \leq X} \lambda(n) \ll X^{\frac{1}{4} + \epsilon} $$
and currently known that
$$ \sum_{n \leq X} \lambda(n) \ll X^{\frac{1}{3}}.$$
These are analogous results to bounds for the Gauss circle problem.
More generally, if $\lambda(n)$ are the coefficients of the Godement-Jacquet $L$-function of a generic irreducible unitary automorphic representation of $\mathrm{GL}(n, \mathbb{R})$ (i.e. $A(1, 1, \ldots, n)$ as in Peter's answer), then one can show that
$$ \sum_{n \leq X} \lambda(n) \ll X^{1 - \frac{2}{d(d+1)} + \epsilon}. $$
This bound follows from a "standard" technical argument of Landau, but it's possible that more is known.
With absolute values, the Ramanujan-on-average bound $O(X)$ is the best one can hope for.
