Mechanism and conditions for anomalous strain relaxation in graded thin films and superlattices