We used a sample of gamma-ray bursts (GRBs) detected by Fermi and Swift to reanalyze the correlation discovered by Amati et al. (
2002A&A...390...81A) between E
pi, the peak energy of the prompt GRB emission, and E
iso, the energy released by the GRB assuming isotropic emission. This correlation has been disputed by various authors, and our aim is to assess whether it is an intrinsic GRB property or the consequence of selection effects. We constructed a sample of Fermi GRBs with homogeneous selection criteria, and we studied their distribution in the E
pi-E
iso plane. Our sample is made of 43 GRBs with a redshift and 243 GRBs without a redshift. We show that GRBs with a redshift follow a broad E
pi-E
iso relation, while GRBs without a redshift show several outliers. We use these samples to discuss the impact of selection effects associated with GRB detection and with redshift measurement. We find that the E
pi-E
iso relation is partly due to intrinsic GRB properties and partly due to selection effects. The lower right boundary of the E
pi-E
iso relation stems from a true lack of luminous GRBs with low E
pi. In contrast, the upper left boundary is attributed to selection effects acting against the detection GRBs with low E
iso and large E
pi that appear to have a lower signal-to-noise ratio. In addition, we demonstrate that GRBs with and without a redshift follow different distributions in the E
pi-E
iso plane. GRBs with a redshift are concentrated near the lower right boundary of the E
pi-E
iso relation. This suggests that it is easier to measure the redshift of GRBs close to the lower E
pi-E
iso boundary and that GRBs with a redshift follow the Amati relation better than the general population. In this context, we attribute the controversy about the reality of the Amati relation to the complex nature of this relation resulting from the combination of a true physical boundary and biases favoring the detection and the measurement of the redshift of GRBs located close to this boundary.