Pour 1 tablespoon oil in a thick-bottomed pan and turn the heat to medium. Pour the spinach into the pan. Within a few minutes, the spinach will wilt down. Sauté to avoid spinach sticking to the pan and turn the heat off after 10 minutes. Once the spinach cools down, transfer to a blender or food processor and blend to a purée.
Boil 2 cups of water and once the water comes to a rolling boil, add paneer slabs. Turn the heat off after paneer has been in the boiling water for 5 minutes and cover the pot with a lid. Let paneer cool in the water, then cut it into 1- by 1/2-inch pieces and set aside.
Roughly crush peppercorns, cardamom and cloves in a mortar and pestle and throw out the cardamom skin. If using a spice grinder, remove the cardamom skin and use only the seeds (save the cardamom skin for chai).
Wipe the pan you used for spinach and heat remaining 2 tablespoons oil over medium heat. Add onions and stir till they get a brownish tinge, then add ginger, garlic, and, if using, Thai chile pepper. Sauté for 2 to 3 minutes. Pour chopped tomatoes followed by pinch of sugar. Once the tomatoes break down, add tomato sauce and spice mix of peppercorns, cardamom, and cloves. Stir till the liquid evaporates and the onion/tomato mixture starts turning dark, about 9 to 10 minutes.
Pour in blended spinach purée. Add salt and 1/2 cup water to adjust consistency. You can add a little bit more if you find the sauce is getting pasty.
Once the spinach mixture boils, gently drop in paneer pieces. Let the paneer soak in the flavors and spices of the spinach purée for about 10 minutes.
Add garam masala. After 4 to 5 minutes, pour milk or cream. They're completely optional—their sole purpose is to enrich the dish.
Eat with naan or take it for lunch next day layered over rice (feel free to thin it out with little bit of water the next day). Palak paneer can be made 2 days in advance for a party, too.