The first is using the transition shorthand property and is explicitly setting the transition-property to the background-color property and also sets a duration, leaving the rest implicit (default values).
The second is explicitly setting the transition-duration property and leaving the rest implicit (default values).
The most noticeable difference between the two is the latter is implicitly setting the transition-property to all which is something you typically want to avoid doing.