Both mean 'sorry', but the use depends on just how serious is the thing that you're apologising for. It's often the case in French that you'll find several words that mean basically the same thing, ...