After the 3-4 hour timespan you mention, your phone is charging very slowly, or not charging at all. The small current makes the powerbank shut off typically, but if your powerbank is misdesigned it may reenable the charging, causing the phone to start and stop charging.