He views his job as President of his base. Period. He loves them. They love him.
Attending lots of rallies reinforces his approval of himself. His narcissism demands attention and adoration from his base.
Yet, I do believe Trump is very instrumental in energizing his base, which helps voter turnout.
The midterms are all about turnout, so Trump hitting the campaign trail is a big boost to the GOP.