What is the use of contrast in Huang Shang's poems dedicated to Wei?

First, write about pine trees to show their majestic posture and indomitable spirit. In the middle four sentences, writing peaches and plums is beautiful, but it can't last long, which is in sharp contrast with Song Qing. In the last four sentences, Li Bai revealed the theme, earnestly warned Huang Shang to learn from pine trees and not to be peaches and plums, and at the same time showed his mind.