Kompia was named after Qi Jiguang, who invented it. When Qi Jiguang led his troops into Fujian in 1563, the Japanese pirates, fearing his name, engaged mainly in guerrilla-style battles. Qi Jiguang noticed that the Japanese pirates could always trace where his troops camped because of the smoke that rose up to the sky when the soldiers prepared their meals. He found out the Japanese pirates had no such problem because they brought onigiri with them. So Qi Jiguang invented a kind of bread with a hole in the center so that they could be strung together to be conveniently carried along. Later, to commemorate Qi Jiguang's victory against the pirate raiders, the bread was named guáng-bǐng (lit. "Jiguang cake").
Kompia is made with lard, onions, salt and flour. A ball of flour is stuffed with a filling of other desired ingredients and flattened with a rolling pin. It is then slapped onto the sides of a traditional home-made Chinese oven and takes approximately 15 minutes to bake. Meat is often used as a filling in the bread.[where?]
A variant with sesame seeds scattered on top and baked without any filling is known as 麻饼. A sweet variant known as 征东饼 (literally "Conquest of the East cake") uses a proportion of sugar to substitute the salt in the dough.