In a P2P file-sharing system, a node finds and retrieves its desired file. If multiple nodes cache the same file to provide others, we can achieve a file-sharing system with low latency and high file availability. However, a node has to spend costs, e.g., processing load or storage capacity, on caching of a file. Consequently, a node may selfishly behave and hesitate to cache a file. In such a case, there is a possibility that unpopular files disappear from the system. In this paper, we aim to accomplish effective caching in the whole system that emerges from autonomous and selfish node behavior. We first discuss relationship between selfish node behavior and system dynamics according to evolutionary game theory. As a result, we show that a file-sharing system can be robust to file disappearance depending on a cost and demand model for caching even if nodes behave selfishly.