Preheat the oven to 375°F/ 190°C.
Season the chicken thighs with salt, black pepper, onion powder, garlic powder, and chili powder.
Add the chicken thighs, skin side down, to a large oven-safe pot or Dutch oven over medium-high heat. Sear the chicken until the skin naturally releases from the pan, about 8 minutes. Flip and sear the other side for another 2-3 minutes. Remove the chicken from the pot and set aside.
While the chicken sears, prepare the remaining ingredients: dice the shallots, slice the celery, mince the garlic, and slice the hearts of palm.
If using fresh corn, cut the kernels from the cob by laying the ear flat on a cutting board and slicing downward along the cob with a sharp knife, staying close to the base of the kernels without cutting into the cob.
Return the pot to medium heat. If there is excess fat, discard some, leaving enough to coat the bottom of the pot. Add the shallots and celery and cook until softened, about 3-4 minutes. Add the garlic and cook for another 30 seconds, just until fragrant.
Add the hearts of palm and season with salt and black pepper. Pour in the chicken stock, scraping the bottom of the pot to loosen any browned bits. Nestle the chicken thighs back into the pot, skin side up. Bring the liquid to a gentle simmer, then transfer the pot to the oven.
Bake until the chicken is cooked through and tender, about 30 minutes.
Remove from the oven and stir in the corn. Garnish with fresh cilantro and more freshly ground black pepper before serving.