If we go by fanon on Derpy, we find that she's actually very accomplished if she IS mentally handicapped. But since that isn't really the case, I think I can safely say she's just supposed to be a silly, unfortunate character and not a hateful mockery.
As for Applejack's lesson, I think it's a...