rechargeable battery pack wiring
That is a temperature sensor. You should reattach it in the new pack, firmly pressed against the cells by the tape.

It is difficult to detect electrically when a NiMH battery is fully charged. One standard technique is to watch for a temperature rise, because once the battery is charged the input energy will be converted to heat instead of stored.

Other packs you have seen without a temperature sensor may be used with chargers which trickle charge (charging so gently that continuous overcharge does not damage the cell) or look for signs in the change of voltage over time, as described in the linked article.