Din Djarin was looking for a replacement for IG-11’s memory circuit, and Motto offered to sell R5 to Djarin to join him on his quest to find the Mines of Mandalore and bathe in the Living Waters. R5 was hesitant to go with Djarin, but was eventually convinced to join him on the mission after Motto threatened to sell him to the Jawas.
For any fan of the popular astromech droid, this R5-D4 The Mandalorian Star Wars T-Shirt is a must have!