Pakistan gained independence but faced many challenges in setting up a new state including communal riots, an influx of refugees, economic issues, and disputes over resources like canal water. Additionally, Pakistan had to establish a new administration while dividing assets with India and integrating princely states, which led to conflicts over regions like Kashmir.