What causes "dieseling"

I remember when I had a vacuum leak back in the day and my engine was idling higher than normal, I'd slam it into park and shut the key off as quick as I could before the rpms would rise. That would keep people in the parking lot from looking at me like I was some sort of hillbilly.