You’ve got two examples of compositions by the same composer with the same four notes in a row, but they function totally differently because of how they fit with the rest of the composition and the rest of the melody that follows.