On the mechanism of bandgap formation in locally resonant finite elastic metamaterials