A conductor cancels electric fields perpendicular to its surface. It does this because electrons move freely within the conductor.
If there is a component of the electric field parallel to the surface, the electrons are moved by that field, decreasing its magnitude. Equilibrium is reached when the electrons can't shift position to decrease the field, at which point there are no electric field components parallel to the surface.
Electric fields pointing directly away from the surface would try to pull electrons out of the surface (or push them further in), and this nominally gives a field gradient inside the material. Extremely large fields (greater than around a GV/m, depending on the material) can overwhelm the attraction between electrons and their atoms, but I'm going to ignore such extreme cases for the rest of this answer. Extreme fields will arise when the amount of charge inside the cage becomes comparable to the total charge on all freely-moving electrons composing the cage itself... so I'm also ignoring that case.
If the field is changing quickly, the electrons' finite mass becomes an issue - it takes time for the electrons to move and cancel out the field. (The plasma frequency is the relevant frequency scale, and it varies by material.) These frequencies are quite high - metals appear shiny because the electrons are cancelling the oscillating electric fields in photons, bouncing the light rays that hit them. Depending on the material, you're probably looking at finite-electron-mass effects in the far-UV to X-ray regime. For the rest of this answer, I'm going to assume you're not asking about charge distributions changing at such rapid rates.
Some "Faraday cages" are made of wire mesh. In this case, the electrons can't move to the spaces between the wires, so there's a limit on their ability to cancel short-wavelength (high-frequency) EM waves, and this limit is tied to the fine-ness of the mesh. This gives a cutoff in wave transmission around the gap size of the mesh: shorter wavelengths can go through the gaps and longer wavelengths treat the mesh as a continuous surface. Commonly, this lets a Faraday cage block radio waves while being cheaper, lighter, and at least partially transmitting visible light - all of which are convenient. For the rest of this answer, I'm going to assume your wavelengths are significantly longer than the mesh size.
That leaves us with two separate cases of concern for low-frequency, low-amplitude electromagnetic waves interacting with contiguous:
- Equal and opposite charges are available: Inside the Faraday cage, you've got positive and negative charges which try to form a dipole electric field. The electrons inside the cage's material move around to cancel out the portions of the electric field intersecting the interior surface of the cage / metal shell. This distorts the dipole in the interior space, but no fields reach the exterior. Your energy considerations don't really apply since the additional energy necessary to get +q into place is cancelled by the energy to get -q into place. The cancellation is approximate, but differences are going to relate to the exact geometry of the cage and placement of the charges within it, and roughly relate to one or more of the caveats above.
- There is a net charge inside the cage: The exact distribution inside the cage will cause electrons to shift around on the interior surface of the metal Faraday cage, and within the cage's metal. The metal will cancel out electric fields within the metal, but there will still be a net charge. If the "shielded" interior charge is +1 Coulomb, this will translate to there being -1 Coulomb shifted toward the interior surface, and a corresponding +1 Coulomb left behind and distributed over the exterior surface. The electric field on the exterior will be perpendicular to the surface at all points, and so only the external geometry will matter outside the Faraday cage - not the distribution of the charges in the interior space or the geometry of the cage's internal surface.
Note also we can exchange "interior" and "exterior" in all the above without loss of generality. The only thing that matters is that the electrons are able to interact with all the electric field lines that cross from one region to the other.