It's used when somoene is trying to teach or show someone who has more experience and knows these things already. For example, if you started teaching me English (I'm a native speaker who has been teaching for twenty years), it might be a case of trying to teach your grandmother to suck eggs.
