They were using an external battery for testing because the onboard battery had insufficient capacity for the test being performed. The fire started for the reason many electrical fires start, inadequate conductor sizing for the circuit current, and lack of an overcurrent protective device, AKA a circuit breaker.