Yeah, it seems like the movie is implying that Sith cultists pulled Palpatine’s broken body from the wreckage of the Death Star, and whatever is left of Palpatine’s spirit is latched onto it. Palpatine is basically a lich, which makes sense if all the Banite Sith are actually just one Sith that possesses apprentice after apprentice.
This is more speculative, but maybe when Vader killed him, Palpatine tried to possess Vader, but failed. Instead, his spirit latched onto Vader’s armor/helmet. In the interim between ROTJ and TFA, Sith cultists retrieved Palpatine’s mangled corpse and the mask of Vader. Through a mix of mechanics, cloning tech and Sith alchemy, they were able to sustain his body enough for Palpatine’s spirit to reanimate it.