Static electricity may be noticeable and then it will disappear. It may or may not return. The reason it disappeared is the change of some variable. It could be a change in the type of shoe soles or the carpet has been soiled. The static electricity on a dirty carpet is less than on a clean one.
Humidity is probably the biggest factor that produces the change.
Moisture in the air will be absorbed by the carpet fibers. The moisture in the fibers is important as the moisture helps dissipate the electrical charge. If there is sufficient moisture present there will not be enough charge built up to produce a shock. An early method used to control static was to place pans of water on the stove or radiators. Moisture is added to some heating systems today by placing a humidifier on the furnace or in the room.