Many times in pictures or/and movies I find samurais and people who know kung fu holding an handheld fan. Why is it?
Does it have some kind of historical background?
An fan
Not an expert, but I've got a fair bit of background on Asian martial arts.
First thing: Kung Fu is a Chinese martial art. Samurais were a Japanese caste of warrior/nobles. So they come from very different cultures, and the use of a fan might mean something completely different in each case. The type of fan you linked to (folding, with ribs and a paper/silk covering) seems to be a Japanese invention, though - Chinese fans looked like this.
Fans came into fashion in Japan around the 7th century, but the first reference I can find to folding fans used as weapons is a legend about Yoshitsune (12th-century samurai), who was supposed to have learned the art of tessenjutsu from the same sylvan deities who taught him the sword. Other references point to its use in the 16th century onwards, notably by Sasaki Kojiro.
The use of the tessen (war fan) by Japanese martial artists is pretty well-attested, especially in places where they couldn't carry swords, and there are a few budo schools who still teach fan techniques in addition to hand-to-hand and sword ones. Morihei Ueshiba, the founder of Aikido, sometimes used a fan in sparring.
The main source on this seems to be Casal's The Lore of the Japanese Fan, which I don't have. I mostly used Ratti's Secrets of the Samurais: A Survey of the Martial Arts of Ancient Japan for this post, you can find the relevant passage here. I also found this page that seems to have more details, but couldn't corroborate any of the informations.