Summer in the city. A resident of a black ghetto is killed by white police after a high-speed chase.

Over questions about the punishment of the police, the situation turns nasty. For three nights, violence is in the air. The streets are crowded with angry teen-agers and with police in riot gear.

That, essentially, was the situation in Miami in May and in Philadelphia this week. The circumstances in the two cities weren't preceisely alike -- in Miami the spark was a jury's acquittal of five policeman, while here it was one policeman's action -- but they were alike enough for the outcomes to be striking in contrast.

In Miami, those three tense nights ended with 18 dead or to die later and 400 injured; in Philadelphia, none dead and 15 injured, none seriously. Miami has been sporadically violent all summer; today, Philadelphia seemed calm.

What was the different?

From this vantage point, it is impossible to say what happened at the crucial moment when Miami turned from a tense situation into a riot. But firsthand observation of several such crucial moments in Philadelphia this week make it fairly clear why the tense situation here this week remained a tense situation and nothing more.

There seem to be two reasons, one general and one specific.

The general one is that the black community of Philadelphia is stronger, bigger, more influential and more prosperous than the black community in Miami. It plays a larger part in city government. A majority of its members see chaos as obviously contrary to their interests.

Philadelphia is about 35 percent black. Mayor William Green's second-in-command is black, and Green's administration cannot afford to write off the black community politically.

Miami by comparison, is about 15 percent black. Black median family income thee is substantially lower. Liberty City, a Miami-area ghetto, is represented by a white congressman; north Philadelphia's congressman is black. r

In the Miami area, the Cubans -- more numerous, better off, with better access to jobs -- are a constant irritant to blacks. In Philadelphia, the small Hispanic community is much poorer than the black one.

North Philadelphia this week had something -- not a great deal, but something -- to lose.

The specific reason for peace in Philadelphia seems to be leadership. In Miami, there were repeated complaints that there was no authority figure to which the kids in the streets would listen. In Philadelphia, two brothers filled exactly that role: state Rep. Milton Street and City Councilman John Street.

For the last three days, the Street brothers have been out in north Philadelphia, controlling presences at those moments when a demonstration can turn into a riot.

For the first time in their careers, they took public stands in favor of moderation, and staked their carefully nurtured reputations in the ghetto on promises that Philadelphia police officer John Ziegler, who shot and killed 17-year-old William Howard Green on Sunday, would be punished swiftly.

Today their promises began to come true. Mayor Green announced at a news conference this afternoon that Ziegler is being suspended from the police force and will be dismissed and charged with murder later.

The Streets came to the fore of the tense situation in north Philadelphia Tuesday night. There was a mass meeting, packed to the rafters, in a church that had on one of its walls a mural depicting a white man in a suit being stabbed through the neck by a black warrior.The meeting was late in starting, because a collection of people ranging from ministers to disc jockeys to revolutionaries were arguing over who would speak. m

The younger people in the church started drifting into the streets. Suddenly, Milton Street stood up from the pews and announced that he was going outside, too.

On the church steps, squinting into a floodlight shining on his face, Street shouted, "There's an argument over who's gonna lead. Well, I'm telling you righ now, I'm gonna lead!" The youngers started chanting, "Street, Street, Street, Street." From then on it was clear that he and his brother had their attention.

Wednesday night, after young Green's funeral, a group of about a hundred started marching down Broad Street, in the direction of downtown Philadelphia. Milton Street, in a van with a bullhorn, caught up to them and convinced them not to go downtown but to assemble instead on a nearby street.

There, the crowd swelled to about 300, and the mood began turning nasty again. The angriest members of the crowd were talking about marching on a nearby police station. Then John Street announced that he had just talked to the No. 2 official in the city government, who had told him that Ziegler would be arrested the next day.

John Street admitted later to a reporter that he had not, in fact, spoken to the official. He said the upcoming arrest was just common knowledge. His announcement, however, seemed to be what led to the dispersal of the crowd.

Several dozen teen-agers did begin to head for the police station, which was under heavy guard, but they were stopped -- not by police, but by people from the neighborhood who had formed a "community patrol" and who linked arms to keep the kids away from the police.

John Street is a lawyer, but Milton Street, the older and more charismatic of the two, does not have a typical politician's resume. He has been, among other things, a community organizer, a hotdog vendor and an ice cream truck driver, but before he was elected to the legislature in 1978 his main source of income was a welfare check.

He is fairly unpopular among whites because of his constant disparaging references to white people and to "the man." He seems to enjoy this reputation, and it certainly hasn't hurt him at the polls: last spring, after one term in the house, he was elected to the state senate.

He and his brother spent many evenings this summer cruising north Philadelphia in a car and stopping on street corners to deliver impromptu speeches using a bullhorn. "We are throwaway people," he would tell those who gathered around him."We are unemployed. We are on welfare. And we don't vote. So we are considered parasites. We must be gotten rid of."

This week, it was obvious that while that was his general view of the system, Milton Street had decided that riot was contrary to the interests of most of his constituents.

A specific case of someone with a stake in calm was Danny Odom, 43, whose north Philadelphia furniture store, Big O's was looted Tuesday night. On Wednesday night, Odom stayed at the store all night, bitter about the teen-agers who had broken in and determined to repel them should they try again.

"I'm not letting nobody drive me away from my place," he said. "It took me 21 years to get this, and I'm not gonna lose it all in one night." After years of saving, Odom bought his store in 1974. That a white man owned the property 10 years ago and Odom does today shows, in microcosm, why north Philadelphia wanted peace.