Kompia was named after Qi Jiguang, who invented it, taking the idea from Japanese onigiri. 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-biǎ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?]