Digital AGC is not necessarily the first block after the ADC, or at least the level detector part of the AGC loop. A significant benefit of doing a subsequent AGC digitally is that you can measure the level (which sets the level of the overall waveform within the bandwidth at the detector) after thorough filtering of the channel signal and rejecting out of band interference. This interference would reduce the signal of interest in band when AGC'd (power measured) earlier in the chain. Also we must be careful to consider all components between the adjusted signal level and the detector (assuming filtering prior to the detector means that the actual power in the signal affecting the components in line can be much higher leading to saturation, clipping and gain compression.
There are also systems where the level is measured digitally and the front-end gain is controlled but it is important to monitor the total signal level at the input the ADC to optimize the trade between quantization noise and clipping, maximizing the SNR of the signal with the proper AGC set-point at the ADC input. (Some clipping is often actually better than backing off too far and introducing more quantization noise in the process).
The AGC loop consists of a detector and a way to adjust the power along with an appropriate loop filter as a control loop. The power adjustment can be done as gain or attenuation or both, depending on what is available in the design. The detection and gain adjust and loop filter can all be done digitally or analog or both and as suggested above it can be a multi-loop design, and the gain can also include stepped gain control.
For more info see these posts: How to adjust receiver gains to avoid saturation and quantization noise to optimise post digital processing?
Role of Power Metric and LPF in AGC(Automatic Gain Controller)