Why nitrogen favors oxygen reduction on graphitic materials