Andrew Cashner's career has mostly been one of "good when healthy" but not often healthy, until the last year or so when he's started to see some gradual decline in his stuff and a commensurate rise in his home runs allowed. Cashner's down a couple of ticks on his fastball velocity and his changeup has never been as effective in the rotation as it was in short stints. He's been around replacement level this year for the Padres due to a higher walk rate and the home runs.
Colin Rea just turned 26 but still has not shown even average control with the Padres, although he has good enough stuff to be a league-average starter if he throws more strikes -- nearly 40% of his pitches this year have been balls, and unless you're striking out an obscene percentage of the hitters you face (which he's not), that's not going to keep you in a rotation.
With Wei-Yin Chen out, Cashner and Rea become the Marlins' fourth and fifth starters, respectively, with Cashner presenting a small upgrade over Justin Nicolino but not a huge one unless he stops giving up home runs. Rea's probably a better fifth-starter option than the Marlins' internal candidates. This seems more like a move that keeps the Marlins afloat in the wild-card race than one that pushes them ahead of any of their competitors.