Pakistan and India have a history of bitter relations and fought three wars over Kashmir .