Strain effects in graphene and graphene nanoribbons: The underlying mechanism