There are typically five planned trajectory correction maneuvers on the way to Mars, referred to as TCM-1 to TCM-5. (Also there is a slot for an emergency TCM-6 a few hours before entry, but it is not expected to be used.) Also I sometimes refer to launch as TCM-0. That's the really, really big TCM.
TCM-0 provides the energy to place the aphelion of the spacecraft at Mars orbit distance, and is timed and directed to get there when Mars will be there. Almost. Due to planetary protection requirements that the final stage of the launch vehicle not impact Mars, TCM-0 is actually designed to just miss Mars.
TCM-1 is about ten days after launch. It's job is to a) take out the planetary protection bias, and b) correct for launch vehicle injection errors. That maneuver is on the order of 10 m/s. Due to execution uncertainty in that maneuver, the spacecraft may not even be on a Mars impact trajectory after TCM-1. But now it is much closer to the desired trajectory.
TCM-2 is about two months after launch. It is on the order of 1 m/s, and corrects for errors in TCM-1, putting the spacecraft close to the desired entry point and time in the Martian atmosphere. While the launch will generally target the desired arrival time to get the selected landing longitude, this can be varied by hours at TCM-2, as was done for Spirit, due to late decisions on the landing site. Note that with months to go, changing the arrival time by a few hours is still a small amount of $\Delta V$ at the time of TCM-2.
In addition to the landing latitude and longitude (the latter determined by the entry time), the flight path angle also needs to be with a fraction of a degree of the target, in order for the heat shield to experience the designed-for environment in both maximum heat rate and total heat load. I'm not sure what you mean by "land on the edge", but you may be referring to targeting the entry point to be just barely inside the impact circle. That is required to have the designed shallow entry flight path angle, e.g. –11.5° for MER. The flight path angle target is fixed. It is not altered to hit a landing site, lifting entry or not. The trajectory is altered to hit the landing site and the desired entry flight path angle.
The remaining TCMs fine-tune the trajectory, and are small or even zero, i.e. cancelled. TCM-3 is about two months before entry, TCM-4 is a week before entry, and TCM-5 is two days before entry. For Opportunity, TCM-3 and TCM-5 were cancelled.
In the end, the entry point in the atmosphere is reached within about one km of the target, and the time of entry within about one second. The entry flight path angle is then within a tenth of a degree of the target. That is where I agree with your "magic" comment. It's pretty amazing, and is due in large part to incredibly high-precision X-band radiometric tracking using Doppler, range, and very-long baseline interferometry.