High Sierra - Why is Recovery HD inside the APFS container?
Placing the recovery volume inside the APFS container allows space sharing. Instead of creating a fixed partition, the unused space inside Preboot and Recovery can be pooled with your normal volume. Only the actual space used by the Recovery files becomes unavailable.

This also simplifies issues if in the future, the Recovery volume needs more space. Instead of a risky resize operation to your data partition, it simply becomes a matter of adjusting the metadata for the Recovery volume.

Finally, any Mac that shipped with an SSD has Internet Recovery, so you have a reasonable solution if the entire drive gets corrupted.