The directional gyro needs to be realigned every so often, but the attitude indicator does not, and I have a hard time finding why.
The self erection device in the attitude gyro that levels it when you start up on the ground also keeps it erect (its axis pointed at the center of the earth) when precession tends to send it off kilter during flight.
Air driven gyros use a pendulous vane arrangement that controls the exhaust ports for the air being sucked through, and which always work to keep the gyro aligned with vertical when stabilized in non-accelerated flight. This system is imperfect, because the pendulous control system is influenced by accelerations and causes its own errors, but works well enough for light aircraft.
I am no expert. My understanding of the Gyroscopic Attitude Indicator is that it is free to move relative to the fuselage in all three axis of motion until you go past 60° in any of the directions of motion. No outside force is applied to the gyroscope until the mechanical limitations of the instrument are reached. Once the mechanical limitations of the instrument are exceeded, the attitude indicator may tumble.
In the case of the Directional Gyroscope, on the other hand, it is constrained to move freely only upon one axis relative to the fuselage. Movement upon the other two axis is possible, but more constrained due to mechanical limitations. When the fuselage reaches attitudes that will exceed those limitations, force will be applied to the gyroscope. That force will be translated to movement in the plane of motion displayed along the axis of freedom of movement. In other words, a pitching motion of the longitudinal axis around the lateral axis, will be translated into precession or yawing motion of the longitudinal axis around the vertical axis.
In the artificial horizon the spin axis of the gyro is tied by the earth's gravity to remain in the earth vertical. That's the reason why this gyro is also known as an Earth gyro. As John K said, this gyro uses a system of erection. Air driven uses pendulous vanes and electrical gyros use a system with electrical motors with gravity switches (with mercury) to orient and continuously maintain the axis to local vertical.
This type of gyro has two degrees of freedom. Those system are not free of errors. In air driven gyros for example, the pendulous system can give you false indications when doing manoeuvres. Basically there are acceleration and turniing errors.
During an acceleration phase at constant altitude, the resetting principle of the artificial horizon results in the horizon bar indicating a nose-up attitud.
Following 180° stabilised turn with a constant attitude and bank, the artificial horizon indicates too high pitch-up and correct banking.
These errors are related to mechanical gyros. In the new electronic system these errors doesn't exist anymore
See this link to fully understand the erection system: https://www.theairlinepilots.com/forum/viewtopic.php?f=35&t=905&p=1204&hilit=artificial+horizon#p1204
Both attitude and directional indicator are using a gyroscope to remain stable inside the aircraft. This means that their orientation is not perturbed by the aircraft evolutions, the horizon of your AI will remain on the real earth horizon whatever the plane attitude and your DI will keep it's internal orientation constant thus helping you in a turn to evaluate your real heading.
On one hand your attitude indicator is aligned with the horizon and display your pitch and inclination. Those informations are only related to your airplane and gravity (normally the horizon is perpendicular to gravity). Most AI have mechanism that keeps them aligned with the gravity otherwise you might develop small error in your pitch angle due to the curvature of the earth on long trips covering large distances.
On the other hand the directional indicator should be aligned with the earth magnetic field to display your heading. Those informations are related to the airplane orientation and the magnetic field. And this field is rotating 15°/hour due to the earth rotation. This information has no other way to be transfered to your system than manually realign the display with a magnetic compass (or electronically in new ones).