That is probably from a leak. If not in the bedboard, then it's in the transition wall. Any signs of a leak on the inside ? Any soft spots or stains on the bedboard or that wall ?
You might want to remove the vinyl insert in that vertical molding, remove the screws holding it on, remove the caulking on the sides of it, and take it off. That would give a glimpse of what that corner looks like, under the trim.
2014 Itasca Spirit 31K Class C
2016 Mazda CX5 on Acme tow dolly- 4 trips ~ 5,800 mi
Now 2017 RWD F150 with a drive shaft disconnect