you and your 1st cousin have the same grandparents, i.e., one of your parents and one of your 1st cousin's parents are brothers/sisters;
you and your 2nd cousin have the same great grandparents, i.e., one of your grandparents and one of your 2nd cousin's grandparents are brothers/sisters;