These are battery holders with integrated wire connectors for AA batteries. The electricity from the batteries is conducted to wires through M3 countersunk screws and M3 embedded nuts. Wires are fixed between holder connectors and embedded nuts. A battery holder can be mounted using two M3 countersunk screws.
Clean the wire holes (which lead from bottom to nut holes) with a 2mm drill bit. Prepare 2 M3 nuts, 2 M3 countersunk screws, and 2 wires per battery. Put the M3 countersunk screws into battery connector holes from battery side. Insert stripped wires into 2mm connector holes and make sure that wires are visible in nut hole. Embed the nuts, and gently tighten screws to make a reliable connection, but do not over tighten them because the plastic part of a battery holder may crack.