The idiom comes from the event in 960 when military commander Zhao Kuangyin removed child emperor Guo Zongxun from the throne and proclaimed himself a new emperor after being presented an imperial dragon robe by his subordinates.
After becoming emperor, Zhao, for fear that military figures might betray him like he betraying his emperor, invited them to a wine banquet and successfully persuaded them to retire. This happened in 961 and gave rise to another idiom, 杯酒釋兵權/杯酒释兵权 (bēi jiǔ shì bīng quán).