Kac's conjecture and the algebra of BPS states