Wang Yuankui was born in 812, during the reign of Emperor Xianzong, when his father Wang Tingcou was probably serving as an officer under Wang Chengzong, then the military governor of Chengde, whose family Wang Tingcou was related to by adoption — as Wang Tingcou's great-grandfather Wang Wugezhi (王五哥之) was an adoptive son of Wang Chengzong's grandfather Wang Wujun. After Wang Chengzong's death in 820, the imperial government briefly took over control of Chengde, but in 821, soldiers led by Wang Tingcou mutinied and killed the imperially-commissioned military governor Tian Hongzheng, and Wang Tingcou subsequently took over as military governor, with the imperial government eventually capitulating and allowing him to do so.
Sometime during Wang Tingcou's rule, he made Wang Yuankui one of the military commanders at Chengde's capital Zhen Prefecture (鎮州), as well as the commander of Chengde army. When Wang Tingcou died in 834, the soldiers supported Wang Yuankui to succeed him, and in 835, then-reigning Emperor Wenzong (Emperor Xianzong's grandson) commissioned Wang Yuankui military governor. It was said that Wang Yuankui changed Wang Tingcou's defiant stance toward the imperial government, and was respectful to the imperial government, often offering tributes to the emperor.
In 837, in response to Wang Yuankui's respectful attitude, Emperor Wenzong sent his cousin Princess Shou'an, a daughter to his uncle Li Wu the Prince of Jiang, to marry Wang. Wang sent his aunt Lady Duan to submit the bride price, and it was said that Lady Duan took to the capital Chang'an with her tributes of 2,000 plates of delicacies, armors, horses, cosmetics and furniture for the princess, and eunuchs and female servants.
In 843, after Liu Congjian the military governor of nearby Zhaoyi Circuit (昭義, headquartered in modern Changzhi, Shanxi) died, Liu Congjian's designated heir, his nephew Liu Zhen, sought imperial commission to inherit the circuit, but then-reigning Emperor Wuzong (Emperor Wenzong's younger brother) did not approve, and instead ordered a general campaign against Liu Zhen. As Emperor Wuzong and the lead chancellor Li Deyu were concerned that Wang, along with his neighbors He Hongjing the military governor of Weibo Circuit (魏博, headquartered in modern Handan, Hebei) and Zhang Zhongwu the military governor of Lulong Circuit (盧龍, headquartered in modern Beijing) — whose three circuits traditionally determined their own military governors and resisted the imperial government from ruling over them — would militarily support Liu Zhen, Emperor Wuzong had Li Deyu draft an edict for him explicitly stating to Wang and He Hongjing that the situation with Zhaoyi was different and that he had no intent to get involved in the succession of military governors of Chengde or Weibo. It was said that therefore, Wang and He Hongjing did not support Liu Zhen.
Subsequently, Emperor Wuzong put Wang and He Hongjing in charge of capturing the three Zhaoyi prefectures east of the Taihang Mountains. It was said that the day that Wang received the imperial edict, he immediately mobilized and took his forces to Zhao Prefecture (趙州, in modern Shijiazhuang) to ready for attack. Under battle orders that Emperor Wuzong subsequently issued to Wang, He Hongjing, Wang Maoyuan (王茂元) the military governor of Heyang Circuit (河陽, headquartered in modern Jiaozuo, Henan), Li Yanzuo (李彥佐) the military governor of Wuning Circuit (武寧, headquartered in modern Xuzhou, Jiangsu), and Liu Mian (劉沔) the military governor of Hedong Circuit (河東, headquartered in modern Taiyuan, Shanxi), Wang was specifically ordered to capture Xing Prefecture (邢州, in modern Xingtai, Hebei). Wang Yuankui quickly captured two Zhaoyi outposts and defeated relief forces Liu Zhen sent, and Emperor Wuzong used this opportunity to issue an edict praising him, in order to pressure Li Yanzuo, Liu Mian, and Wang Maoyuan to step up their attack. Emperor Wuzong also bestowed the honorary chancellor title of Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事) on Wang Yuankui. When, by contrast, He Hongjing was not attacking Zhaoyi forces immediately, Wang Yuankui submitted multiple secret petitions accusing He Hongjing of being ambiguous in his attitude, and Emperor Wuzong pressured He Hongjing by ordering one of the main imperial generals, Wang Zai the military governor of Zhongwu Circuit (忠武, headquartered in modern Xuchang, Henan), to go through Weibo territory in attacking Zhaoyi; this frightened He Hongjing, and he finally launched his troops in attacking Zhaoyi.
In spring 844, the Hedong officer Yang Bian (楊弁) mutinied, expelling then-military governor Li Shi, in cooperation with Liu Zhen. In response, Emperor Wuzong briefly refocused the military efforts to target Yang instead, and he ordered Wang Yuankui to lead his soldiers through Tumen (土門, in modern Shijiazhuang) over the Taihang Mountains to support a counterattack by Hedong forces under the command of the officer Wang Feng (王逢). However, as Hedong forces under the eunuch monitor Lü Yizhong (呂義忠) quickly recaptured Hedong's capital Taiyuan and killed Yang, it appeared that Wang Yuankui never actually launched his forces over the Taihang Mountains.
In fall 844, Pei Wen (裴問) the brother of Liu Congjian's wife Lady Pei, whom Liu Zhen had put in charge of the three Zhaoyi prefectures east of the Taihang Mountains but who was angered that Liu Zhen's officer Liu Xi (劉溪) was forcing his soldiers to pay taxes even as they were fighting, surrendered Xing Prefecture to Wang Yuankui. Subsequently, the other two prefectures — Ming (洺州, in modern Handan) and Ci (磁州, in modern Handan as well) surrendered to He Hongjing. When the Zhaoyi officer Wei Yuantan (魏元談), who was defending Yaoshan (堯山, in modern Xingtai), surrendered to Wang, Wang, who was angry that he was unable to capture Yaoshan up to this point, executed Wei. Further, he also killed some 20 Zhaoyi residents who were disrespectful to him during the campaign, and this caused the Zhaoyi soldiers to be apprehensive and close up their cities to ready for battle again. Emperor Wuzong, under Li Deyu's advice, issued an edict ordering Wang to stop his vengeance and ordering the new military governor of Zhaoyi, Lu Jun (盧均), to comfort the region. (Soon thereafter, Liu Zhen's officer Guo Yi (郭誼) killed Liu Zhen and surrendered the remainder of the circuit to imperial forces.) After the end of the campaign, Emperor Wuzong rewarded Wang by bestowing on him the honorific title of Taifu (太傅) and creating him the Duke of Taiyuan.
In 854, Wang died, and in spring 855 the death was reported to the imperial government. Then-reigning Emperor Xuānzong allowed his son Wang Shaoding to inherit the circuit, and bestowed the posthumous honor of Taishi (太師) on Wang Yuankui.