Battery does not stay charged!!!

On the second and third pictures, it shows a THING on the left side of the battery, which has some wires connected to it but they are held with another wire not by its required clip things lol WHAT IS THAT THING? And also what is the grey box with the orange sticker on it...just trying to get to know the parts of the engine little by little. Thanks Yous!