Context. Observations in the X-ray energy band are often limited by the background because of the low fluxes of typical sources. The background can easily be higher than the signal itself, and thus any mission with the scientific goal of observing faint and/or extended sources in the X-ray band must deal with the background problem. ESA has recently selected "the hot and energetic universe" as science theme for the second large-class mission in the Cosmic Vision science program, to be pursued with an advanced X-ray observatory to be launched in 2028, and at present ATHENA is the proposal that is most likely to be selected for this slot. The mission is aimed to place an X-ray telescope in the L2 orbit equipped with an X-ray Integral Field Unit (X-IFU) based on high spectral resolution transition-edge microcalorimeters, and has among its goals the detection and characterization of high-redshift active galactic nuclei (AGNs), cluster of galaxies and their outskirts, which is why great care must be taken to reduce the background impact on the detection/characterization of these sources. Aims. The background is composed of a diffuse component and an internal particle component for any satellite operating in the X-ray band. We take as reference the X-ray IFU instrument that will be placed onboard the ATHENA mission to analyze both these components and their variability for different orbits, observational conditions and/or design choices. We also show how different background levels affect the instrumental performance, and the scientific results obtainable with the instrument in the best configuration. The X-IFU is a cryogenic X-ray spectrometer, based on a large array of 3840 transition-edge sensors (TES) of 250 μm side, with a spectral energy resolution of 2.5 eV in the 0.2−10 keV energy band, over a field of view of 5 × 5 arcmin 2 , high count rate capability and a 5 arcsec angular resolution. Methods. There are no experimental data about the background experienced by microcalorimeters in the L2 orbit, and thus the particle background levels were calculated by means of Monte Carlo simulations: we considered the original design configuration and an improved configuration aimed to reduce the unrejected background, and tested them in the L2 orbit and in the low Earth orbit, comparing the results with experimental data reported by other X-ray instruments. For the diffuse component, we used the background levels measured from a 1 sr region representative of typical high galactic latitude pointings and analyzed the variations expected with the different orbital conditions. To show the results obtainable with the improved configuration we simulated the observation of a faint, high-redshift, point source (F [0.5−10 keV] ∼ 6.4 × 10 −16 erg cm −2 s −1 , z = 3.7), and of a hot galaxy cluster at R 200 (S b [0.5−2 keV] = 8.61 × 10 −16 erg cm −2 s −1 arcmin −2 , T = 6.6 keV). Results. First we confirm that implementing an active cryogenic anticoincidence reduces the particle background by an order of magnitude and brings ...