Adjust oven rack to middle position and heat oven to 400 degrees. If using a Pot of Beans, soak and cook them, reserving bean cooking liquid in a 1 quart measuring cup. If using canned beans, drain them, reserving bean liquid in a 1 quart liquid measuring cup. Add enough broth to equal 1 quart.
Heat oil in a large pot; add onions and sauté until nearly tender, about 4 minutes. Add 4 cloves minced garlic, basil, oregano, fennel and pepper flakes; continue to cook another minute or so. Add broth, beans, tomatoes, and orzo; bring to a simmer.
While mixture heats, mix panko, 1 clove minced garlic, oil, and a pinch of salt in a medium bowl.
When bean mixture starts to simmer, stir in parsley. Taste and adjust seasonings, including salt and pepper to taste. Turn mixture into a 13- by 19-inch pan. (*If using feta, sprinkle it now.) Sprinkle with panko and bake until bubbly and golden brown, about 30 minutes. Remove from oven, let rest a few minutes, and then serve.