How does remap tag affect the spawning of robot?

I noticed that the syntax for calling robot_state_publisher in launch file is different for controller loaded launch file and joint_state_publisher launch file.

when writing a launch file that uses joint state publisher this robot_state_publisher tag is enough to visualize the entire robot.

<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>

However when writing a launch file for controllers, the above robot_state_publisher tag is not enough to visulaize the entire robot in rviz. Infact only the bottom of robot is visualised.To fully visualise the robot the remap tag has to be included is robot_state_publisher tag as shown below.

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
   <remap from="/joint_states" to="/pi_robot/joint_states" />
  </node>

The difference is remap tag ? can you tell me why this is the case?

Normally this remap is done because the controllers .yaml file of the robot has as name space that /pi_robot, and therefore we need to remap it to that topic to be able to make everything work.